package com.weaver.drools.business.execution.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.weaver.drools.business.execution.service.IELogDetailService;
import com.weaver.drools.common.dao.ELogDetailDao;
import com.weaver.drools.common.entity.ELogDetail;
@Service
public class ELogDetailServiceImpl implements IELogDetailService {

	@Autowired
	private ELogDetailDao ELogDetailDao;
	@Override
	public ELogDetail findById(Long logdetailid) {
		// TODO Auto-generated method stub
		return ELogDetailDao.findELogDetailByLogdetailid(logdetailid);
	}

	@Override
	public void saveELogDetail(ELogDetail logDetail) {
		ELogDetailDao.saveOrUpdate(logDetail);
	}

	@Override
	public void updateELogDetail(ELogDetail logDetail) {
		ELogDetailDao.saveOrUpdate(logDetail);
	}

	@Override
	public void deleteById(Long logdetailid) {
		ELogDetailDao.deleteById(logdetailid);
	}

	@Override
	public List<ELogDetail> findLogDetailByBusinesslogid(Long businesslogid) {
		String hql = " from ELogDetail where isdeleted=0 ";
		if(businesslogid!=null&&!"".equals(businesslogid)) {
			hql+=" and businesslogid = "+businesslogid;
		}
		List<ELogDetail> list = ELogDetailDao.findListByhql(hql);
		return list;
	}

}
